<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>$永远的24k纯帅$</title>
  <script>

    //练习:有一个黄色的小狗,叫大黄,今年已经三岁了,250斤的重量每次走路都很慢,喜欢吃大骨头
    //创建对象
    var smallDog=new Object();
    smallDog.name="大黄";
    smallDog.age=3;
    smallDog.color="黄色";
    smallDog.weight="250";
    smallDog.eat=function () {
        console.log("我要吃大骨头");
    };
    smallDog.walk=function () {
        console.log("走一步摇尾巴");
    };
    smallDog.eat();//方法的调用
    smallDog.walk();






    //练习:创建一个手机对象,手机有型号,有颜色,可以打电话和发短信

    var phone=new Object();
    phone.size="iphone8";
    phone.color="黑色";
    phone.call=function () {
        console.log("打电话");
    };
    phone.sendMessage=function () {
      console.log("你干啥捏,我烧锅炉呢");
    };

    phone.call();
    phone.sendMessage();
  </script>
</head>
<body>


</body>
</html>